package org.jivesoftware.smackx;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

public class RemoteRosterEntry
{
  private String user;
  private String name;
  private final List<String> groupNames = new ArrayList();

  public RemoteRosterEntry(String paramString1, String paramString2, String[] paramArrayOfString)
  {
    this.user = paramString1;
    this.name = paramString2;
    if (paramArrayOfString != null)
      this.groupNames.addAll(Arrays.asList(paramArrayOfString));
  }

  public String getUser()
  {
    return this.user;
  }

  public String getName()
  {
    return this.name;
  }

  public Iterator<String> getGroupNames()
  {
    synchronized (this.groupNames)
    {
      return Collections.unmodifiableList(this.groupNames).iterator();
    }
  }

  public String[] getGroupArrayNames()
  {
    synchronized (this.groupNames)
    {
      return (String[])Collections.unmodifiableList(this.groupNames).toArray(new String[this.groupNames.size()]);
    }
  }

  public String toXML()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("<item jid=\"").append(this.user).append("\"");
    if (this.name != null)
      localStringBuilder.append(" name=\"").append(this.name).append("\"");
    localStringBuilder.append(">");
    synchronized (this.groupNames)
    {
      Iterator localIterator = this.groupNames.iterator();
      while (localIterator.hasNext())
      {
        String str = (String)localIterator.next();
        localStringBuilder.append("<group>").append(str).append("</group>");
      }
    }
    localStringBuilder.append("</item>");
    return localStringBuilder.toString();
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.jivesoftware.smackx.RemoteRosterEntry
 * JD-Core Version:    0.6.1
 */